﻿//using Quartz;
//using Quartz.Spi;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading.Tasks;

//namespace MQ.Core.Admin.Schedule
//{
//    public class ScheduledJobFactory : IJobFactory
//    {
//        private readonly IServiceProvider serviceProvider;

//        public ScheduledJobFactory(IServiceProvider serviceProvider)
//        {
//            this.serviceProvider = serviceProvider;
//        }

//        public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
//        {
//            return serviceProvider.GetService(typeof(IJob)) as IJob;
//        }

//        public void ReturnJob(IJob job)
//        {
//            var disposable = job as IDisposable;
//            if (disposable != null)
//            {
//                disposable.Dispose();
//            }
//        }
//    }
//}
